package com.hnkywl.sts.service.jhgl;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.hnkywl.sts.dao.base.SjzdzDao;
import com.hnkywl.sts.dao.jhgl.BgjhDao;
import com.hnkywl.sts.dao.jhgl.BgjhhzDao;
import com.hnkywl.sts.dao.jhgl.BgjhmxDao;
import com.hnkywl.sts.dao.sys.GgDao;
import com.hnkywl.sts.entity.base.Sjzdz;
import com.hnkywl.sts.entity.jhgl.Bgjh;
import com.hnkywl.sts.entity.jhgl.Bgjhhz;
import com.hnkywl.sts.entity.jhgl.Bgjhhzmx;
import com.hnkywl.sts.entity.jhgl.Bgjhmx;
import com.hnkywl.sts.entity.sys.Gg;
import com.hnkywl.sts.service.base.BmService;
import com.hnkywl.sts.service.sys.YgService;
import com.hnkywl.sts.util.ReflectionUtils;
import net.ruixin.orm.hibernate.Page;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;

import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * User: ZHUCHG
 * Date: 13-6-26
 * Time: 下午3:22
 * To change this template use File | Settings | File Templates.
 */
@Service
public class BgjhService {
    private BgjhDao bgjhDao;
    private BgjhmxDao bgjhmxDao;
    private BgjhhzDao bgjhhzDao;
    private BmService bmService;
    private SjzdzDao sjzdzDao;
    private GgDao ggDao;

    public String findList(String type, Long jhdwId, Long gyzId, Integer jhnf, Integer jhyf, Date startdata, Date enddate, String code, String sm, String sssbcl, int pageNo, int pageSize) {
        Page<Map> page = bgjhDao.findList(type, jhdwId, gyzId, jhnf, jhyf, startdata, enddate, code, sm, null, sssbcl, pageNo, pageSize);
        Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
        String json = gson.toJson(page.getResult());
        return "{\"total\":" + page.getTotalCount() + ",\"rows\":" + json + "}";
    }

    public String findBgjhByBgjhhzIdList(Long id, int pageNo, int pageSize) {
        Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
        Page<Bgjh> bgjhPage = bgjhDao.findBgjhListsByBgjhhzId(id, pageNo, pageSize);
        String bgjhJson = gson.toJson(bgjhPage.getResult());
        return "{\"total\":" + bgjhPage.getTotalCount() + ",\"rows\":" + bgjhJson + "}";
    }

    /**
     * 首页显示保供计划数
     *
     * @return
     */
    public String findAllBgjh() {
        Integer bgjhNum = 0;
        try {
            Date aDate = new Date(System.currentTimeMillis());
            Calendar calendar = GregorianCalendar.getInstance();
            calendar.setTime(aDate);
            Integer year = calendar.get(Calendar.YEAR);    //获取年
            Integer month = calendar.get(Calendar.MONTH) + 1;   //获取月份，0表示1月份
            List bgjhList = bgjhDao.findBgjhList(year, month);
            if (bgjhList != null && bgjhList.size() > 0) {
                bgjhNum = bgjhList.size();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return bgjhNum.toString();
    }

    public Bgjh find(Long id) {
        return bgjhDao.get(id);
    }

    public Bgjhhz findhz(Long id) {
        return bgjhhzDao.get(id);
    }

    public Boolean checkWzmx(Long id, String wzbm) {
        return this.bgjhDao.checkWzmx(id, wzbm);
    }

    public String findBgjhmxByBgjh(Long id) {
        Page<Map> page = bgjhmxDao.findBgjhmxByBgjhIdAndHz(id, 0l, null, 1, -1);
//        Bgjh bgjh = bgjhDao.get(id);
        String json = "";
        if (page != null) {
            Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
            json = gson.toJson(page.getResult());
//            json = BaseUtils.fetchCollectionToJson(null, false, bgjh.getBgjhmxList(), "id", "wzgg.id", "wzgg.oldcode", "wzgg.code", "wzgg.name", "wzgg.ggxh", "wzgg.th", "wzgg.cz", "cd.id", "cd.z", "sbcl", "ckj", "dw", "jhsl", "dhrq", "bz", "zt", "ph");
        }
        json = "{\"rows\":" + json + "}";
        return json;
    }

    /**
     * 查询已经提交没有还没有出来的保供物资计划明细
     *
     * @param id
     * @return
     */
    public List<Map> findBgjhmxByBgjhId(Long id, Long hz) {
        return bgjhmxDao.findBgjhmxByBgjhId(id, hz);
    }

    public String findBgjhmxByBgjhIds(Long id, Long hz, String typeId, int pageNo, int pageSize) {
        Page<Map> page = bgjhmxDao.findBgjhmxByBgjhIdAndHz(id, hz, typeId, pageNo, pageSize);
        Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
        String json = gson.toJson(page.getResult());
        return "{\"total\":" + page.getTotalCount() + ",\"rows\":" + json + "}";
    }

    //保供计划明细导出全部
    public List<Map> findBgjhmxByBgjhIds(Long id, Long hz, String typeId) {
        Page<Map> page = bgjhmxDao.findBgjhmxByBgjhIdAndHz(id, hz, typeId, 1, 10000);
        return page.getResult();
    }

    /**
     * 保供物资计划汇总明细
     *
     * @param typeId
     * @param id
     * @return
     */
    public String findWzjhhzmxByBgjhId(String typeId, Long id) {
        if (StringUtils.isNotEmpty(typeId) && typeId.equals("2")) {
            id = bgjhDao.get(id).getBgjhhz().getId();
        }
        List<Map> list = bgjhhzDao.findHzmxList(id);
        Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
        String json = gson.toJson(list);
        return "{\"rows\":" + json + "}";
    }

    public List<Map> findWzjhhzmxByBgjhIds(String typeId, Long id) {
        if (StringUtils.isNotEmpty(typeId) && typeId.equals("2")) {
            id = bgjhDao.get(id).getBgjhhz().getId();
        }
        List<Map> list = bgjhhzDao.findHzmxList(id);
        return list;
    }

    public String findWzjhhzmxByBgjhIdDetail(Long id, String typeId, int pageNo, int pageSize) {
        if (StringUtils.isNotEmpty(typeId) && typeId.equals("2")) {
            id = bgjhDao.get(id).getBgjhhz().getId();
        }
        Page<Map> page = bgjhhzDao.findHzmxListDetail(id, pageNo, pageSize);
        Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
        String json = gson.toJson(page.getResult());
        return "{\"total\":" + page.getTotalCount() + ",\"rows\":" + json + "}";
    }

    /**
     * 合同信息
     *
     * @param typeId
     * @param id
     * @return
     */
    public String findHtxxByBgjhId(String typeId, Long id) {
        if (StringUtils.isNotEmpty(typeId) && typeId.equals("2")) {
            id = bgjhDao.get(id).getBgjhhz().getId();
        }
        List<Map> list = bgjhhzDao.findHtxxList(id);
        Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
        String json = gson.toJson(list);
        return "{\"rows\":" + json + "}";
    }

    public String findHtxxByBgjhIds(String typeId, Long id, int pageNo, int pageSize) {
        if (StringUtils.isNotEmpty(typeId) && typeId.equals("2")) {
            id = bgjhDao.get(id).getBgjhhz().getId();
        }
        Page<Map> page = bgjhhzDao.findHtxxLists(id, pageNo, pageSize);
        Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
        String json = gson.toJson(page.getResult());
        return "{\"total\":" + page.getTotalCount() + ",\"rows\":" + json + "}";
    }

    /**
     * 采购单信息
     *
     * @param typeId
     * @param id
     * @return
     */
    public String findCgdBybgjhId(String typeId, Long id) {
        if (StringUtils.isNotEmpty(typeId) && typeId.equals("2")) {
            id = bgjhDao.get(id).getBgjhhz().getId();
        }
        List<Map> list = bgjhhzDao.findCgdxxList(id);
        Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
        String json = gson.toJson(list);
        return "{\"rows\":" + json + "}";
    }

    public String findCgdBybgjhIds(String typeId, Long id, int pageNo, int pageSize) {
        if (StringUtils.isNotEmpty(typeId) && typeId.equals("2")) {
            id = bgjhDao.get(id).getBgjhhz().getId();
        }
        Page<Map> page = bgjhhzDao.findCgdxxLists(id, pageNo, pageSize);
        Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
        String json = gson.toJson(page.getResult());
        return "{\"total\":" + page.getTotalCount() + ",\"rows\":" + json + "}";
    }

    public String findThBgjhmxByBgjh(Long id) {
        List<Map> list = bgjhDao.findThBgjhmxByBgjh(id);
        Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
        String json = gson.toJson(list);
        return "{\"rows\":" + json + "}";
    }

    @Transactional
    public void save(Bgjh bgjh) {
        Calendar cal = Calendar.getInstance();
        String bm = bmService.getWzjhbm("ZGWZJH");
        bgjh.setBm(bm);
        bgjh.setSm(bgjh.getSm() + bm);
        bgjh.setCreateUser(YgService.getCurrentYg());
        bgjh.setCreateOrgan(YgService.getCurrentYg().getZggs());
        bgjh.setCreateDepartment(YgService.getCurrentYg().getZgjg());
        bgjhDao.save(bgjh);
        if (!CollectionUtils.isEmpty(bgjh.getBgjhmxList()))
            for (Bgjhmx bgjhmx : bgjh.getBgjhmxList()) {
                if (bgjhmx.getCd().getId() == null)
                    bgjhmx.setCd(null);
                if (bgjhmx.getDhrq() == null) {
                    cal.add(Calendar.MONTH, 1);
                    bgjhmx.setDhrq(cal.getTime());
                }
                bgjhmx.setSbcl(bgjhmx.getSbcl().equals("材料") ? "cl" : "sb");
                bgjhmx.setBgjh(bgjh);
                bgjhmxDao.save(bgjhmx);
            }
    }

    @Transactional
    public void edit(Bgjh bgjh) {
        Bgjh temp = bgjhDao.get(bgjh.getId());
        if (!CollectionUtils.isEmpty(temp.getBgjhmxList())) {
            for (Bgjhmx b : temp.getBgjhmxList())
                bgjhmxDao.delete(b.getId());
        }
        if (!CollectionUtils.isEmpty(bgjh.getBgjhmxList()))
            for (Bgjhmx bgjhmx : bgjh.getBgjhmxList()) {
                if (bgjhmx.getDhrq() == null) {
                    Calendar cal = Calendar.getInstance();
                    cal.add(Calendar.MONTH, 1);
                    bgjhmx.setDhrq(cal.getTime());
                }
                if (bgjhmx.getCd().getId() == null)
                    bgjhmx.setCd(null);
                bgjhmx.setBgjh(temp);
                bgjhmxDao.save(bgjhmx);
            }
    }

    @Transactional
    public Long saveMx(Bgjhmx bgjhmx) {
        String ph = sjzdzDao.get(bgjhmx.getCd().getId()).getZ();
        if (bgjhmx.getDhrq() == null) {
            Calendar cal = Calendar.getInstance();
            cal.add(Calendar.MONTH, 1);
            bgjhmx.setDhrq(cal.getTime());
        }
        if (bgjhmx.getId() != null) {
            Bgjhmx temp = bgjhmxDao.get(bgjhmx.getId());
            ReflectionUtils.getInstance(temp, bgjhmx);
            temp.setLastUpdated(new Date());
            temp.setPh(ph);
            bgjhmxDao.save(temp);
            return temp.getId();
        } else {
            bgjhmx.setPh(ph);
            bgjhmx.setDateCreated(new Date());
            bgjhmx.setLastUpdated(bgjhmx.getDateCreated());
            bgjhmx.setCreateUser(YgService.getCurrentYg());
            bgjhmx.setCreateOrgan(YgService.getCurrentYg().getZggs());
            bgjhmx.setCreateDepartment(YgService.getCurrentYg().getZgjg());
            bgjhmxDao.save(bgjhmx);
            return bgjhmx.getId();
        }
    }

    @Transactional
    public void delMx(Long bgjhmxId) {
        Bgjhmx temp = bgjhmxDao.get(bgjhmxId);
        temp.setDeleted(1);
        temp.setLastUpdated(new Date());
        bgjhmxDao.save(temp);
    }

    //退回明细
    @Transactional
    public void mxTh(Long bgjhmxId) {
        Bgjhmx temp = bgjhmxDao.get(bgjhmxId);
        temp.setZt(2);
        temp.setLastUpdated(new Date());
        bgjhmxDao.save(temp);
    }


    @Transactional
    public void submit(List<Long> ids) {
        for (Long id : ids) {
            Bgjh bgjh = bgjhDao.get(id);
            if (bgjh.getBgjhmxList().isEmpty()) {
                throw new RuntimeException("【" + bgjh.getSm() + "】该计划没有维护计划明细，请维护明细后再提交!");
            }
            if (bgjh.getZt() == 2) {
                throw new RuntimeException("【" + bgjh.getSm() + "】该计划已经提交!请刷新页面!");
            }
            bgjh.setZt(2);
            bgjh.setBgjhtjr(YgService.getCurrentYg());
            bgjh.setBgjhtjrq(new Date());
        }
        List<Bgjh> list = bgjhDao.findBgjhByIds(ids);
        List<Map> mx = bgjhmxDao.collectBgjhhzmx(ids);
        Bgjhhz bgjhhz = collectMonthlyPlan(list, mx);
        bgjhhzDao.save(bgjhhz);
    }

    @Transactional
    public void collect(List<Long> ids) {
        List<Bgjh> list = bgjhDao.findBgjhByIds(ids);
        List<Map> mx = bgjhmxDao.collectBgjhhzmx(ids);
        Bgjhhz bgjhhz = collectMonthlyPlan(list, mx);
        bgjhhzDao.save(bgjhhz);
    }

    @Transactional
    public void delete(List<Long> ids) {
        for (Long id : ids)
            bgjhDao.delete(id);
    }

    @Transactional
    public void reject(List<Long> ids) {
        for (Long id : ids) {
            Bgjh bgjh = bgjhDao.get(id);
//            if (bgjh.getZt() != 2) {
//                throw new RuntimeException("记录不是提交状态");
//            }
            bgjh.setZt(1);
        }
    }

    /**
     * 提交非月度计划
     *
     * @param bgjh
     * @return
     */
    public Bgjhhz submitExceptMonthlyPlan(Bgjh bgjh, List<Map> mx, Integer zt) {
        Bgjhhz bgjhhz = copyBgjhValue(bgjh, zt);
        bgjh.setBgjhhz(bgjhhz);
        if (zt == 2)
            zt = 1;
        bgjhhz.setBgjhhzr(YgService.getCurrentYg());
        bgjhhz.setBgjhhzrq(new Date());
        bgjhhz = copyBgjhmxValue(bgjhhz, mx, zt);
        return bgjhhz;
    }

    /**
     * 汇总月度计划
     *
     * @param bgjhList
     * @return
     */
    public Bgjhhz collectMonthlyPlan(List<Bgjh> bgjhList, List<Map> mx) {
        Bgjh temp = bgjhList.get(0);
        Bgjhhz bgjhhz = copyBgjhValue(temp, 2);
        Integer c = bgjhhzDao.checkMonthlyHzPlanSm(bgjhhz.getSm());
        if (c != 0)
            bgjhhz.setSm(bgjhhz.getSm() + c);
        for (Bgjh bgjh : bgjhList) {
            bgjh.setBgjhhz(bgjhhz);
            if (bgjh.getZt() == 3) {
                throw new RuntimeException("【" + bgjh.getSm() + "】该计划已经汇总!请刷新页面!");
            }
            bgjh.setZt(3);
        }
        bgjhhz = copyBgjhmxValue(bgjhhz, mx, 1);
        return bgjhhz;
    }


    /**
     * 根据计划的创建时间，获取创建时间下个月一号的时间，如果当前时间大于该时间，返回当前时间
     *
     * @param date
     * @return
     */
    public Date getNextMonthFirst(Date date) {
        Calendar lastDate = Calendar.getInstance();
        Date currentDate = new Date();
        lastDate.setTime(date);
        if (lastDate.getTime().getMonth() == 12) {
            lastDate.add(Calendar.YEAR, 1);//减一个月
            lastDate.set(Calendar.MONTH, 1);//把日期设置当年的第一个月
            lastDate.set(Calendar.DATE, 1);//把日期设置为当月第一天
        } else {
            lastDate.add(Calendar.MONTH, 1);//减一个月
            lastDate.set(Calendar.DATE, 1);//把日期设置为当月第一天
        }
        if (lastDate.getTime().after(currentDate))
            return lastDate.getTime();
        return currentDate;
    }


    public Bgjhhz copyBgjhValue(Bgjh bgjh, Integer zt) {
        Calendar cal = Calendar.getInstance();
        int year = cal.get(Calendar.YEAR);//获取年份
        int month = cal.get(Calendar.MONTH);//获取月份
        int day = cal.get(Calendar.DATE);//获取日
        int hour = cal.get(Calendar.HOUR_OF_DAY);//小时
        int minute = cal.get(Calendar.MINUTE);//分
        int second = cal.get(Calendar.SECOND);//秒
        String bm = bmService.getWzjhbm("ZGWZJH");
        Bgjhhz bgjhhz = new Bgjhhz();
        bgjhhz.setBm(bm);
        bgjhhz.setJyjg(bgjh.getJyjg());
        bgjhhz.setLj(bgjh.getLj());
        bgjhhz.setJhdw(bgjh.getJhdw());
        bgjhhz.setSm(bgjh.getJyjg().getQc() + "的汇总计划  " + bm + "  " + year + "年" + (month + 1) + "月" + day + "日 " + hour + "时" + minute + "分" + second + "秒");
        bgjhhz.setJhsj(bgjh.getDateCreated());
        bgjhhz.setZt(zt);
        bgjhhz.setCreateUser(YgService.getCurrentYg());
        bgjhhz.setCreateOrgan(YgService.getCurrentYg().getZggs());
        bgjhhz.setCreateDepartment(YgService.getCurrentYg().getZgjg());
        return bgjhhz;
    }

    public Bgjhhz copyBgjhmxValue(Bgjhhz bgjhhz, List<Map> mx, Integer zt) {
        List<Bgjhhzmx> hzmx = new ArrayList<Bgjhhzmx>();
        if (!CollectionUtils.isEmpty(mx))
            for (Map temp : mx) {
                Bgjhhzmx bgjhhzmx = new Bgjhhzmx();
                bgjhhzmx.setZt(zt);
                bgjhhzmx.setPh((String) temp.get("ph"));
                bgjhhzmx.setBgjhhz(bgjhhz);
                bgjhhzmx.setSbcl((String) temp.get("sbcl"));
                Gg wzgg = new Gg();
                BigDecimal id = (BigDecimal) temp.get("wzgg.id");
                wzgg.setId(id.longValue());
                bgjhhzmx.setWzgg(wzgg);
                BigDecimal cdId = (BigDecimal) temp.get("cd.id");
                Sjzdz cd = new Sjzdz();
                if (cdId == null) {
                    cd.setId(132591l);
                } else {
                    cd.setId(cdId.longValue());
                }
                bgjhhzmx.setCd(cd);
                BigDecimal jhsl = (BigDecimal) temp.get("jhsl");
                BigDecimal jhjs = (BigDecimal) temp.get("jhjs");
                bgjhhzmx.setJhsl(jhsl.doubleValue());
                bgjhhzmx.setJhjs(jhjs.doubleValue());
                bgjhhzmx.setSl1(0.0);
                bgjhhzmx.setSl2(0.0);
                bgjhhzmx.setSbjs(jhjs.doubleValue());
                bgjhhzmx.setSbsl(jhsl.doubleValue());
                bgjhhzmx.setDhrq((Date) temp.get("dhrq"));
                bgjhhzmx.setBz((String) temp.get("bz"));
                bgjhhzmx.setCreateUser(YgService.getCurrentYg());
                bgjhhzmx.setCreateOrgan(YgService.getCurrentYg().getZggs());
                bgjhhzmx.setCreateDepartment(YgService.getCurrentYg().getZgjg());
                bgjhhzmx.setXsxt_xsdh((String) temp.get("xsxt_xsdh"));
                bgjhhzmx.setXsxt_htbm((String) temp.get("xsxt_htbm"));
                bgjhhzmx.setSfhdj((String) temp.get("sfhdj"));
                BigDecimal hsj = (BigDecimal) temp.get("hsj");
                BigDecimal hse = (BigDecimal) temp.get("hse");
                if (null != hsj && null != hse) {
                    bgjhhzmx.setHsj(hsj.doubleValue());
                    bgjhhzmx.setHsje(hse.doubleValue());
                    bgjhhzmx.setBhsj(hsj.doubleValue() / 1.17);
                }
                hzmx.add(bgjhhzmx);
            }
        bgjhhz.setBgjhhzmxList(hzmx);
        bgjhhz.setBgjhhzr(YgService.getCurrentYg());
        bgjhhz.setBgjhhzrq(new Date());
        return bgjhhz;
    }

    public boolean checkGG(String name, String ggxh, String cz) {
        Gg gg = ggDao.findByPro(name, ggxh, cz);
        if (gg == null) {
            return false;

        } else {
            return true;
        }

    }

    @Transactional
    public void saveUploadBgjhmx(Long bgjhId, List<Map<String, String>> listMap) throws ParseException {
        for (Map<String, String> map : listMap) {
            Gg gg = ggDao.findByPro(map.get("name").toString(), map.get("ggxh").toString(), map.get("cz").toString());
            Sjzdz cd = sjzdzDao.get(126591l);
            Bgjh bgjh = bgjhDao.get(bgjhId);
            Bgjhmx bgjhmx = new Bgjhmx();
            bgjhmx.setBgjh(bgjh);
            bgjhmx.setWzgg(gg);
            bgjhmx.setCd(cd);
            bgjhmx.setDw(gg.getDw());
            bgjhmx.setJhsl(Double.valueOf(map.get("jszl").toString()));
            bgjhmx.setJhjs(1d);
            bgjhmx.setSbcl("cl");
            bgjhmx.setPh("攀钢钒");
            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
            Date jhrq_date = sdf.parse(map.get("jhrq").toString());
            bgjhmx.setDhrq(jhrq_date);
            bgjhmx.setDateCreated(new Date());
            bgjhmx.setLastUpdated(bgjhmx.getDateCreated());
            bgjhmx.setCreateUser(YgService.getCurrentYg());
            bgjhmx.setCreateOrgan(YgService.getCurrentYg().getZggs());
            bgjhmx.setCreateDepartment(YgService.getCurrentYg().getZgjg());
            bgjhmx.setHsj(Double.valueOf(map.get("hsj").toString()));
            bgjhmx.setHse(Double.valueOf(map.get("hse").toString()));
            bgjhmx.setXsxt_htbm(map.get("xsxt_htbm").toString());
            bgjhmx.setXsxt_xsdh(map.get("xsxt_xsdh").toString());
            bgjhmx.setSfhdj(map.get("sfhdj").toString());
            bgjhmxDao.save(bgjhmx);
        }
    }

    @Autowired
    public void setBgjhDao(BgjhDao bgjhDao) {
        this.bgjhDao = bgjhDao;
    }

    @Autowired
    public void setBgjhmxDao(BgjhmxDao bgjhmxDao) {
        this.bgjhmxDao = bgjhmxDao;
    }

    @Autowired
    public void setBgjhhzDao(BgjhhzDao bgjhhzDao) {
        this.bgjhhzDao = bgjhhzDao;
    }

    @Autowired
    public void setBmService(BmService bmService) {
        this.bmService = bmService;
    }

    @Autowired
    public void setSjzdzDao(SjzdzDao sjzdzDao) {
        this.sjzdzDao = sjzdzDao;
    }

    @Autowired
    public void setGgDao(GgDao ggDao) {
        this.ggDao = ggDao;
    }


}
